\(\int \sec ^4(c+d x) (a \cos (c+d x)+b \sin (c+d x))^4 \, dx\) [83]

   Optimal result
   Rubi [A] (verified)
   Mathematica [C] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F(-1)]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 28, antiderivative size = 103 \[ \int \sec ^4(c+d x) (a \cos (c+d x)+b \sin (c+d x))^4 \, dx=\left (a^4-6 a^2 b^2+b^4\right ) x-\frac {4 a b \left (a^2-b^2\right ) \log (\cos (c+d x))}{d}+\frac {b^2 \left (3 a^2-b^2\right ) \tan (c+d x)}{d}+\frac {a b (a+b \tan (c+d x))^2}{d}+\frac {b (a+b \tan (c+d x))^3}{3 d} \]

[Out]

(a^4-6*a^2*b^2+b^4)*x-4*a*b*(a^2-b^2)*ln(cos(d*x+c))/d+b^2*(3*a^2-b^2)*tan(d*x+c)/d+a*b*(a+b*tan(d*x+c))^2/d+1
/3*b*(a+b*tan(d*x+c))^3/d

Rubi [A] (verified)

Time = 0.18 (sec) , antiderivative size = 103, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.179, Rules used = {3165, 3563, 3609, 3606, 3556} \[ \int \sec ^4(c+d x) (a \cos (c+d x)+b \sin (c+d x))^4 \, dx=\frac {b^2 \left (3 a^2-b^2\right ) \tan (c+d x)}{d}-\frac {4 a b \left (a^2-b^2\right ) \log (\cos (c+d x))}{d}+x \left (a^4-6 a^2 b^2+b^4\right )+\frac {b (a+b \tan (c+d x))^3}{3 d}+\frac {a b (a+b \tan (c+d x))^2}{d} \]

[In]

Int[Sec[c + d*x]^4*(a*Cos[c + d*x] + b*Sin[c + d*x])^4,x]

[Out]

(a^4 - 6*a^2*b^2 + b^4)*x - (4*a*b*(a^2 - b^2)*Log[Cos[c + d*x]])/d + (b^2*(3*a^2 - b^2)*Tan[c + d*x])/d + (a*
b*(a + b*Tan[c + d*x])^2)/d + (b*(a + b*Tan[c + d*x])^3)/(3*d)

Rule 3165

Int[cos[(c_.) + (d_.)*(x_)]^(m_)*(cos[(c_.) + (d_.)*(x_)]*(a_.) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(n_.), x_Symb
ol] :> Int[(a + b*Tan[c + d*x])^n, x] /; FreeQ[{a, b, c, d}, x] && EqQ[m + n, 0] && IntegerQ[n] && NeQ[a^2 + b
^2, 0]

Rule 3556

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rule 3563

Int[((a_) + (b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[b*((a + b*Tan[c + d*x])^(n - 1)/(d*(n - 1))
), x] + Int[(a^2 - b^2 + 2*a*b*Tan[c + d*x])*(a + b*Tan[c + d*x])^(n - 2), x] /; FreeQ[{a, b, c, d}, x] && NeQ
[a^2 + b^2, 0] && GtQ[n, 1]

Rule 3606

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(a*c - b
*d)*x, x] + (Dist[b*c + a*d, Int[Tan[e + f*x], x], x] + Simp[b*d*(Tan[e + f*x]/f), x]) /; FreeQ[{a, b, c, d, e
, f}, x] && NeQ[b*c - a*d, 0] && NeQ[b*c + a*d, 0]

Rule 3609

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[d*
((a + b*Tan[e + f*x])^m/(f*m)), x] + Int[(a + b*Tan[e + f*x])^(m - 1)*Simp[a*c - b*d + (b*c + a*d)*Tan[e + f*x
], x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && GtQ[m, 0]

Rubi steps \begin{align*} \text {integral}& = \int (a+b \tan (c+d x))^4 \, dx \\ & = \frac {b (a+b \tan (c+d x))^3}{3 d}+\int (a+b \tan (c+d x))^2 \left (a^2-b^2+2 a b \tan (c+d x)\right ) \, dx \\ & = \frac {a b (a+b \tan (c+d x))^2}{d}+\frac {b (a+b \tan (c+d x))^3}{3 d}+\int (a+b \tan (c+d x)) \left (a \left (a^2-3 b^2\right )+b \left (3 a^2-b^2\right ) \tan (c+d x)\right ) \, dx \\ & = \left (a^4-6 a^2 b^2+b^4\right ) x+\frac {b^2 \left (3 a^2-b^2\right ) \tan (c+d x)}{d}+\frac {a b (a+b \tan (c+d x))^2}{d}+\frac {b (a+b \tan (c+d x))^3}{3 d}+\left (4 a b \left (a^2-b^2\right )\right ) \int \tan (c+d x) \, dx \\ & = \left (a^4-6 a^2 b^2+b^4\right ) x-\frac {4 a b \left (a^2-b^2\right ) \log (\cos (c+d x))}{d}+\frac {b^2 \left (3 a^2-b^2\right ) \tan (c+d x)}{d}+\frac {a b (a+b \tan (c+d x))^2}{d}+\frac {b (a+b \tan (c+d x))^3}{3 d} \\ \end{align*}

Mathematica [C] (verified)

Result contains complex when optimal does not.

Time = 0.39 (sec) , antiderivative size = 105, normalized size of antiderivative = 1.02 \[ \int \sec ^4(c+d x) (a \cos (c+d x)+b \sin (c+d x))^4 \, dx=\frac {-3 i (a+i b)^4 \log (i-\tan (c+d x))+3 i (a-i b)^4 \log (i+\tan (c+d x))-6 b^2 \left (-6 a^2+b^2\right ) \tan (c+d x)+12 a b^3 \tan ^2(c+d x)+2 b^4 \tan ^3(c+d x)}{6 d} \]

[In]

Integrate[Sec[c + d*x]^4*(a*Cos[c + d*x] + b*Sin[c + d*x])^4,x]

[Out]

((-3*I)*(a + I*b)^4*Log[I - Tan[c + d*x]] + (3*I)*(a - I*b)^4*Log[I + Tan[c + d*x]] - 6*b^2*(-6*a^2 + b^2)*Tan
[c + d*x] + 12*a*b^3*Tan[c + d*x]^2 + 2*b^4*Tan[c + d*x]^3)/(6*d)

Maple [A] (verified)

Time = 1.27 (sec) , antiderivative size = 101, normalized size of antiderivative = 0.98

method result size
derivativedivides \(\frac {a^{4} \left (d x +c \right )-4 a^{3} b \ln \left (\cos \left (d x +c \right )\right )+6 a^{2} b^{2} \left (\tan \left (d x +c \right )-d x -c \right )+4 a \,b^{3} \left (\frac {\tan \left (d x +c \right )^{2}}{2}+\ln \left (\cos \left (d x +c \right )\right )\right )+b^{4} \left (\frac {\tan \left (d x +c \right )^{3}}{3}-\tan \left (d x +c \right )+d x +c \right )}{d}\) \(101\)
default \(\frac {a^{4} \left (d x +c \right )-4 a^{3} b \ln \left (\cos \left (d x +c \right )\right )+6 a^{2} b^{2} \left (\tan \left (d x +c \right )-d x -c \right )+4 a \,b^{3} \left (\frac {\tan \left (d x +c \right )^{2}}{2}+\ln \left (\cos \left (d x +c \right )\right )\right )+b^{4} \left (\frac {\tan \left (d x +c \right )^{3}}{3}-\tan \left (d x +c \right )+d x +c \right )}{d}\) \(101\)
parts \(\frac {a^{4} \left (d x +c \right )}{d}+\frac {b^{4} \left (\frac {\tan \left (d x +c \right )^{3}}{3}-\tan \left (d x +c \right )+d x +c \right )}{d}+\frac {4 a^{3} b \ln \left (\sec \left (d x +c \right )\right )}{d}+\frac {4 a \,b^{3} \left (\frac {\tan \left (d x +c \right )^{2}}{2}+\ln \left (\cos \left (d x +c \right )\right )\right )}{d}+\frac {6 a^{2} b^{2} \left (\tan \left (d x +c \right )-d x -c \right )}{d}\) \(112\)
risch \(4 i a^{3} b x -4 i x a \,b^{3}+a^{4} x -6 a^{2} b^{2} x +b^{4} x +\frac {8 i a^{3} b c}{d}-\frac {8 i a \,b^{3} c}{d}-\frac {4 i b^{2} \left (-9 a^{2} {\mathrm e}^{4 i \left (d x +c \right )}+3 b^{2} {\mathrm e}^{4 i \left (d x +c \right )}+6 i a b \,{\mathrm e}^{4 i \left (d x +c \right )}-18 a^{2} {\mathrm e}^{2 i \left (d x +c \right )}+3 b^{2} {\mathrm e}^{2 i \left (d x +c \right )}+6 i a b \,{\mathrm e}^{2 i \left (d x +c \right )}-9 a^{2}+2 b^{2}\right )}{3 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{3}}-\frac {4 a^{3} b \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}{d}+\frac {4 a \,b^{3} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}{d}\) \(218\)
parallelrisch \(\frac {36 b \left (\frac {\cos \left (3 d x +3 c \right )}{3}+\cos \left (d x +c \right )\right ) \left (a -b \right ) a \left (a +b \right ) \ln \left (\sec \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )-36 b \left (\frac {\cos \left (3 d x +3 c \right )}{3}+\cos \left (d x +c \right )\right ) \left (a -b \right ) a \left (a +b \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )-36 b \left (\frac {\cos \left (3 d x +3 c \right )}{3}+\cos \left (d x +c \right )\right ) \left (a -b \right ) a \left (a +b \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )+3 \left (a^{4} d x -6 a^{2} b^{2} d x +b^{4} d x -2 a \,b^{3}\right ) \cos \left (3 d x +3 c \right )+2 \left (9 a^{2} b^{2}-2 b^{4}\right ) \sin \left (3 d x +3 c \right )+3 \left (3 a^{4} d x -18 a^{2} b^{2} d x +3 b^{4} d x +2 a \,b^{3}\right ) \cos \left (d x +c \right )+18 \sin \left (d x +c \right ) a^{2} b^{2}}{3 d \left (\cos \left (3 d x +3 c \right )+3 \cos \left (d x +c \right )\right )}\) \(271\)
norman \(\frac {\frac {8 a \,b^{3}}{d}+\left (-a^{4}+6 a^{2} b^{2}-b^{4}\right ) x +\frac {40 a \,b^{3} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{8}}{d}+\left (-3 a^{4}+18 a^{2} b^{2}-3 b^{4}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{8}+\left (-3 a^{4}+18 a^{2} b^{2}-3 b^{4}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{10}+\left (-a^{4}+6 a^{2} b^{2}-b^{4}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+\left (a^{4}-6 a^{2} b^{2}+b^{4}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{12}+\left (a^{4}-6 a^{2} b^{2}+b^{4}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{14}+\left (3 a^{4}-18 a^{2} b^{2}+3 b^{4}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}+\left (3 a^{4}-18 a^{2} b^{2}+3 b^{4}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}-\frac {8 a \,b^{3} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{14}}{d}-\frac {48 a \,b^{3} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}}{d}+\frac {48 a \,b^{3} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{10}}{d}-\frac {40 a \,b^{3} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}}{d}+\frac {24 b^{2} \left (2 a^{2}-b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7}}{d}-\frac {2 b^{2} \left (6 a^{2}-b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}-\frac {2 b^{2} \left (6 a^{2}-b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{13}}{d}+\frac {2 b^{2} \left (18 a^{2}-19 b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{3 d}+\frac {2 b^{2} \left (18 a^{2}-19 b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{9}}{3 d}-\frac {4 b^{2} \left (18 a^{2}-b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{3 d}-\frac {4 b^{2} \left (18 a^{2}-b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{11}}{3 d}}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1\right )^{3} \left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{4}}-\frac {4 a b \left (a^{2}-b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{d}-\frac {4 a b \left (a^{2}-b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{d}+\frac {4 a b \left (a^{2}-b^{2}\right ) \ln \left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )}{d}\) \(674\)

[In]

int(sec(d*x+c)^4*(cos(d*x+c)*a+b*sin(d*x+c))^4,x,method=_RETURNVERBOSE)

[Out]

1/d*(a^4*(d*x+c)-4*a^3*b*ln(cos(d*x+c))+6*a^2*b^2*(tan(d*x+c)-d*x-c)+4*a*b^3*(1/2*tan(d*x+c)^2+ln(cos(d*x+c)))
+b^4*(1/3*tan(d*x+c)^3-tan(d*x+c)+d*x+c))

Fricas [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 119, normalized size of antiderivative = 1.16 \[ \int \sec ^4(c+d x) (a \cos (c+d x)+b \sin (c+d x))^4 \, dx=\frac {3 \, {\left (a^{4} - 6 \, a^{2} b^{2} + b^{4}\right )} d x \cos \left (d x + c\right )^{3} + 6 \, a b^{3} \cos \left (d x + c\right ) - 12 \, {\left (a^{3} b - a b^{3}\right )} \cos \left (d x + c\right )^{3} \log \left (-\cos \left (d x + c\right )\right ) + {\left (b^{4} + 2 \, {\left (9 \, a^{2} b^{2} - 2 \, b^{4}\right )} \cos \left (d x + c\right )^{2}\right )} \sin \left (d x + c\right )}{3 \, d \cos \left (d x + c\right )^{3}} \]

[In]

integrate(sec(d*x+c)^4*(a*cos(d*x+c)+b*sin(d*x+c))^4,x, algorithm="fricas")

[Out]

1/3*(3*(a^4 - 6*a^2*b^2 + b^4)*d*x*cos(d*x + c)^3 + 6*a*b^3*cos(d*x + c) - 12*(a^3*b - a*b^3)*cos(d*x + c)^3*l
og(-cos(d*x + c)) + (b^4 + 2*(9*a^2*b^2 - 2*b^4)*cos(d*x + c)^2)*sin(d*x + c))/(d*cos(d*x + c)^3)

Sympy [F(-1)]

Timed out. \[ \int \sec ^4(c+d x) (a \cos (c+d x)+b \sin (c+d x))^4 \, dx=\text {Timed out} \]

[In]

integrate(sec(d*x+c)**4*(a*cos(d*x+c)+b*sin(d*x+c))**4,x)

[Out]

Timed out

Maxima [A] (verification not implemented)

none

Time = 0.33 (sec) , antiderivative size = 116, normalized size of antiderivative = 1.13 \[ \int \sec ^4(c+d x) (a \cos (c+d x)+b \sin (c+d x))^4 \, dx=\frac {3 \, {\left (d x + c\right )} a^{4} - 18 \, {\left (d x + c - \tan \left (d x + c\right )\right )} a^{2} b^{2} + {\left (\tan \left (d x + c\right )^{3} + 3 \, d x + 3 \, c - 3 \, \tan \left (d x + c\right )\right )} b^{4} - 6 \, a b^{3} {\left (\frac {1}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right )^{2} - 1\right )\right )} - 6 \, a^{3} b \log \left (-\sin \left (d x + c\right )^{2} + 1\right )}{3 \, d} \]

[In]

integrate(sec(d*x+c)^4*(a*cos(d*x+c)+b*sin(d*x+c))^4,x, algorithm="maxima")

[Out]

1/3*(3*(d*x + c)*a^4 - 18*(d*x + c - tan(d*x + c))*a^2*b^2 + (tan(d*x + c)^3 + 3*d*x + 3*c - 3*tan(d*x + c))*b
^4 - 6*a*b^3*(1/(sin(d*x + c)^2 - 1) - log(sin(d*x + c)^2 - 1)) - 6*a^3*b*log(-sin(d*x + c)^2 + 1))/d

Giac [A] (verification not implemented)

none

Time = 0.41 (sec) , antiderivative size = 104, normalized size of antiderivative = 1.01 \[ \int \sec ^4(c+d x) (a \cos (c+d x)+b \sin (c+d x))^4 \, dx=\frac {b^{4} \tan \left (d x + c\right )^{3} + 6 \, a b^{3} \tan \left (d x + c\right )^{2} + 18 \, a^{2} b^{2} \tan \left (d x + c\right ) - 3 \, b^{4} \tan \left (d x + c\right ) + 3 \, {\left (a^{4} - 6 \, a^{2} b^{2} + b^{4}\right )} {\left (d x + c\right )} + 6 \, {\left (a^{3} b - a b^{3}\right )} \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{3 \, d} \]

[In]

integrate(sec(d*x+c)^4*(a*cos(d*x+c)+b*sin(d*x+c))^4,x, algorithm="giac")

[Out]

1/3*(b^4*tan(d*x + c)^3 + 6*a*b^3*tan(d*x + c)^2 + 18*a^2*b^2*tan(d*x + c) - 3*b^4*tan(d*x + c) + 3*(a^4 - 6*a
^2*b^2 + b^4)*(d*x + c) + 6*(a^3*b - a*b^3)*log(tan(d*x + c)^2 + 1))/d

Mupad [B] (verification not implemented)

Time = 23.65 (sec) , antiderivative size = 546, normalized size of antiderivative = 5.30 \[ \int \sec ^4(c+d x) (a \cos (c+d x)+b \sin (c+d x))^4 \, dx=\frac {\frac {3\,a^4\,\cos \left (c+d\,x\right )\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{2}-\frac {b^4\,\sin \left (3\,c+3\,d\,x\right )}{3}+\frac {3\,b^4\,\cos \left (c+d\,x\right )\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{2}-\frac {a\,b^3\,\cos \left (3\,c+3\,d\,x\right )}{2}+\frac {3\,a^2\,b^2\,\sin \left (c+d\,x\right )}{2}+\frac {a^4\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,\cos \left (3\,c+3\,d\,x\right )}{2}+\frac {b^4\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,\cos \left (3\,c+3\,d\,x\right )}{2}+\frac {3\,a^2\,b^2\,\sin \left (3\,c+3\,d\,x\right )}{2}+\frac {a\,b^3\,\cos \left (c+d\,x\right )}{2}+3\,a\,b^3\,\ln \left (-\frac {\cos \left (c+d\,x\right )}{{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}\right )\,\cos \left (c+d\,x\right )-3\,a^3\,b\,\ln \left (-\frac {\cos \left (c+d\,x\right )}{{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}\right )\,\cos \left (c+d\,x\right )-3\,a^2\,b^2\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,\cos \left (3\,c+3\,d\,x\right )-3\,a\,b^3\,\cos \left (c+d\,x\right )\,\ln \left (\frac {1}{{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}\right )+3\,a^3\,b\,\cos \left (c+d\,x\right )\,\ln \left (\frac {1}{{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}\right )+a\,b^3\,\ln \left (-\frac {\cos \left (c+d\,x\right )}{{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}\right )\,\cos \left (3\,c+3\,d\,x\right )-a^3\,b\,\ln \left (-\frac {\cos \left (c+d\,x\right )}{{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}\right )\,\cos \left (3\,c+3\,d\,x\right )-a\,b^3\,\ln \left (\frac {1}{{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}\right )\,\cos \left (3\,c+3\,d\,x\right )+a^3\,b\,\ln \left (\frac {1}{{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}\right )\,\cos \left (3\,c+3\,d\,x\right )-9\,a^2\,b^2\,\cos \left (c+d\,x\right )\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d\,\left (\frac {3\,\cos \left (c+d\,x\right )}{4}+\frac {\cos \left (3\,c+3\,d\,x\right )}{4}\right )} \]

[In]

int((a*cos(c + d*x) + b*sin(c + d*x))^4/cos(c + d*x)^4,x)

[Out]

((3*a^4*cos(c + d*x)*atan(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2)))/2 - (b^4*sin(3*c + 3*d*x))/3 + (3*b^4*cos(c
+ d*x)*atan(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2)))/2 - (a*b^3*cos(3*c + 3*d*x))/2 + (3*a^2*b^2*sin(c + d*x))/
2 + (a^4*atan(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2))*cos(3*c + 3*d*x))/2 + (b^4*atan(sin(c/2 + (d*x)/2)/cos(c/
2 + (d*x)/2))*cos(3*c + 3*d*x))/2 + (3*a^2*b^2*sin(3*c + 3*d*x))/2 + (a*b^3*cos(c + d*x))/2 + 3*a*b^3*log(-cos
(c + d*x)/cos(c/2 + (d*x)/2)^2)*cos(c + d*x) - 3*a^3*b*log(-cos(c + d*x)/cos(c/2 + (d*x)/2)^2)*cos(c + d*x) -
3*a^2*b^2*atan(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2))*cos(3*c + 3*d*x) - 3*a*b^3*cos(c + d*x)*log(1/cos(c/2 +
(d*x)/2)^2) + 3*a^3*b*cos(c + d*x)*log(1/cos(c/2 + (d*x)/2)^2) + a*b^3*log(-cos(c + d*x)/cos(c/2 + (d*x)/2)^2)
*cos(3*c + 3*d*x) - a^3*b*log(-cos(c + d*x)/cos(c/2 + (d*x)/2)^2)*cos(3*c + 3*d*x) - a*b^3*log(1/cos(c/2 + (d*
x)/2)^2)*cos(3*c + 3*d*x) + a^3*b*log(1/cos(c/2 + (d*x)/2)^2)*cos(3*c + 3*d*x) - 9*a^2*b^2*cos(c + d*x)*atan(s
in(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2)))/(d*((3*cos(c + d*x))/4 + cos(3*c + 3*d*x)/4))